<?php
class App_Module_Admin_Component_Blogs_Ctrl_Http_Ajax extends App_Module_Admin_Component_Blogs_Ctrl_Http
{
    protected function GetOnlyRightBlog()
    {
		$blog = $this->GetBlogFromQueryId();
        if (!$blog)
    	{
			Mozg::Lib('messanger')->createMessage(Mozg_Lang::_('BLOG_NOT_FOUND'), MESSAGE_ERROR);
	        Mozg::Response('http')->SetStatus(Mozg_Response::StatusError);
    	}

    	return $blog;
    }
    
    public function mediaaddPrAction()
    {
    	$blog = $this->GetOnlyRightBlog();
		if (!$blog) return;
		
    	$this->MediaForArticle($blog);
    }
    
    public function savethemePrAction()
    {
    	$blog = $this->GetOnlyRightBlog();
    	if (!$blog) return;
    	
    	$this->SaveThemeArticles($blog);
    }
}